package cc.co.bengkeljava.codex.designpattern.facade.ext1;

public class FacadeDvd {

	private Dvd dvd;
	private DvdPlayer dvdPlayer;
	private Tv tv;

	public FacadeDvd(Dvd dvd, DvdPlayer dvdPlayer, Tv tv) {
		this.dvd = dvd;
		this.dvdPlayer = dvdPlayer;
		this.tv = tv;
	}

	public void watchDvd() {
		System.out.println("mulai menonton dvd di rumah");
		
		tv.turnOn();
		tv.changeModeDvd();
		dvdPlayer.turnOn();
		dvd.takeDvd();
		dvdPlayer.insert(dvd);
		dvdPlayer.play();
	}

	public void endDvd() {
		System.out.println("Berhenti menonton dvd di rumah");
		
		dvdPlayer.stop();
		dvdPlayer.reject();
		dvd.backDvd();
		dvdPlayer.turnOff();
		tv.changeModeTv();
		tv.turnOff();
	}
}
